package com.zbkj.crmeb.user.dao;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.zbkj.crmeb.user.model.UserMemberRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zbkj.crmeb.user.request.MemberRecordRequest;
import com.zbkj.crmeb.user.response.MemberRecordResponse;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


import java.util.List;

/**
 * <p>
 * 用户购买会员记录表 Mapper 接口
 * </p>
 *
 * @author wuzp
 * @since 2022-05-11
 */
public interface UserMemberRecordDao extends BaseMapper<UserMemberRecord> {

    List<MemberRecordResponse> getMerMemberList(MemberRecordRequest request);

    /**
     * 功能描述: 指定条件的付费会员数
     * @Param: [wrapper]
     * @Return: java.lang.Integer
     * @Author: wangzh
     * @Date: 2023/1/5 17:58
     */
    @Select("select count(*) from (select count(*) from eb_user_member_record ${ew.customSqlSegment}) a")
    Integer getPaidMemberCount(@Param("ew") Wrapper wrapper);

}
